Page({

  /**
   * 页面的初始数据
   */
  data: {
    user:[],
    money:'0.00',
    fwmoney:'0.00',
    number:'0',
    kouling:'请输入红包口令'
  },
  bindReward: function (event) {
    if(event.detail.value<1){
      this.setData({
        money: 1
      })
    }else{
      this.setData({
        money: event.detail.value
      })
    }
  },
  bindNumReward: function (event) {
    if (event.detail.value < 1) {
      this.setData({
        number: 1
      })
    } else {
      this.setData({
        number: event.detail.value
      })
    }
  },
  bindMoney:function(e){
    this.setData({
      money: '',
    })
  },
  bindNum: function (e) {
    this.setData({
      number: '',
    })
  },
  bindKl: function (e) {
    this.setData({
      kouling: '',
    })
  },
  formSubmit: function (e) {
    console.log(e.detail.value);
    var that = this;
    var formData = e.detail.value;
    if(formData.kouling == ''){
      
    }

  },  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    let that = this;
    var value = wx.getStorageSync('user');
    if (value) {
      wx.getStorage({
        key: 'user',
        success: function (res) {
          console.log(res),
          that.setData({
            user: res.data
          })
        }
      })
    }
  }
})